<template>
	<div class="personalData">
		<!--个人主要信息-->
		<div class="personalData_container_per">
			<van-cell title="头像">
				<img v-if="userInfo.pic==null" src="../../../static/images/user-portrait.png" alt="" style="width: 4.4rem;height: 4.4rem;border-radius: 50%;margin-top: 1rem">
				<img v-else :src=userInfo.pic style="width: 4.4rem;height: 4.4rem;border-radius: 50%;margin-top: 1rem">
			</van-cell>
			<van-cell title="联系人姓名" :value=userInfo.realname />
			<van-cell title="手机号" :value=userInfo.phone />
		</div>
		<!-- <van-cell title="绑定其他账号" is-link :value=userInfo.zhicheng @click="$router.push('/public/bindotherwechat')" /> -->
		<!--红字信息展示-->
		<div class="read_word">
			<span>*以下门店信息只能修改一次</span>
		</div>
		<!--个人门店信息等-->
		<div class="personalData_container_shop">
			<van-cell title="门店名称" :value=userInfo.zhicheng />
			<van-cell title="门店位置" :value=userInfo.address />
		</div>
		<!--修改密码-->
		<!-- <div class="personalData_container_passWord">
			<van-cell title="修改密码" @click="eventClickChangePassword" is-link value="" />
		</div> -->
		<div class="personalData_container_passWord">
			<van-cell title="安全设置" @click="$router.push('/public/securitySettings')" is-link />
		</div>
		<!-- <div class="personalData_container_exit">
			<van-cell title="注销" @click="eventClickLoginOut" />
		</div> -->
	</div>
</template>

<script>
	import { Cell, CellGroup, Dialog } from 'vant';

	export default {
		name: "personalData",
		components: { [Cell.name]: Cell, [CellGroup.name]: CellGroup, [Dialog.name]: Dialog },
		data() {
			return {}
		},
		computed: {
			userInfo() {
				return this.$store.state.options.user.oda;
			}
		},
		created() {
		},
		methods: {
			eventClickLoginOut: function () {
				Dialog.confirm({
					title: '提示',
					message: '确认注销'
				}).then(() => {
					let params = {
						token: this.$store.state.options.user.token
					}
					this.$util.postRequestInterface('/api/home/user/logout', params.token, (res) => {
                        window.sessionStorage.clear();
                        window.localStorage.clear();
						this.$router.push('/login');
					});
				}).catch(() => {

				});
			},
			eventClickChangePassword() {
				this.$router.push('/public/changePassword')
			},
			// bindnewwetchat(){
			//     url="api/home/"
			//     this.$util.postRequestInterface(url, params, (res) => {
			//         items.page = items.page + 1;
			//         if (res.data == '') {
			//             items.loading = false;
			//             items.finished = true;
			//         } else {
			//
			//         }
			//     });
			// }
		},

	}
</script>

<style scoped lang = "scss">
	.personalData {
		/*个人主要信息*/
		.personalData_container_per {
			width: 100%;
			.van-cell {
				&:nth-child(1) {
					display: flex;
					align-items: center;
				}
			}
		}

		/*红字展示*/
		.read_word {
			width: 100%;
			height: 3rem;
			line-height: 3rem;
			margin: 0 auto;
			background-color: #eeeeee;

			span {
				margin-left: 5%;
				font-size: 1.3rem !important;
				color: #ff0000 !important;
			}
		}

		/*修改密码样式*/
		.personalData_container_passWord {
			border-top: 0.5rem solid #eeeeee;
			/* border-bottom: 0.5rem solid #eeeeee; */
		}
	}
</style>
